home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Web Graphics with Shout 3D
/
Interactive Web Graphics With Shout 3D.iso
/
pc
/
Shout3Ddemo
/
Shout3d_runtime
/
codebase
/
applets
/
SelectAPanoramaApplet.java
< prev
next >
Wrap
Text File
|
2000-09-07
|
4KB
|
111 lines
/**
Company: Eyematic Interfaces
Project: Shout3D 2.0 Sample Code
Class: Viewer
Date: April 17, 2000
Description: Class for Viewer
(C) Copyright Eyematic Interfaces, Inc. - 1997-2000 - All rights reserved
*/
package applets;
import java.applet.*;
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import java.util.Date;
import java.net.URL;
import shout3d.core.*;
import shout3d.*;
/**
* Shout3D viewer
*
* @author Dave Westwood
* @author Paul Isaacs
* @author Jim Stewartson
*/
public class SelectAPanoramaApplet extends Shout3DApplet {
java.awt.Checkbox smoothCheckBox = new java.awt.Checkbox();
java.awt.Choice sceneChoice = new java.awt.Choice();
String frontmaps[] = {"../images/envmap_haze/front.jpg", "../images/envmap_redrock/front.jpg", "../images/envmap_colorcube/front.jpg"};
String rightmaps[] = {"../images/envmap_haze/right.jpg", "../images/envmap_redrock/right.jpg", "../images/envmap_colorcube/right.jpg"};
String backmaps[] = {"../images/envmap_haze/back.jpg", "../images/envmap_redrock/back.jpg", "../images/envmap_colorcube/back.jpg"};
String leftmaps[] = {"../images/envmap_haze/left.jpg", "../images/envmap_redrock/left.jpg", "../images/envmap_colorcube/left.jpg"};
String upmaps[] = {"../images/envmap_haze/up.jpg", "../images/envmap_redrock/up.jpg", "../images/envmap_colorcube/up.jpg"};
String downmaps[] = {"../images/envmap_haze/down.jpg", "../images/envmap_redrock/down.jpg", "../images/envmap_colorcube/down.jpg"};
public void initShout3DPanel(){
int width = this.size().width;
int height = this.size().height;
panel = new SelectAPanoramaPanel(this, width, height-28);
setBackground(java.awt.Color.lightGray);
smoothCheckBox.setState(false);
smoothCheckBox.setLabel("Smooth");
add(smoothCheckBox);
smoothCheckBox.setFont(new Font("Dialog", Font.PLAIN, 12));
smoothCheckBox.setBounds(24,height-28+2,69,24);
sceneChoice.addItem("Blue Haze / Rock");
sceneChoice.addItem("Red Rock");
sceneChoice.addItem("Color Cube");
add(sceneChoice);
sceneChoice.setBounds(108,height-28+4,120,25);
SymItem lSymItem = new SymItem();
smoothCheckBox.addItemListener(lSymItem);
sceneChoice.addItemListener(lSymItem);
}
class SymItem implements java.awt.event.ItemListener
{
public void itemStateChanged(java.awt.event.ItemEvent event)
{
Object object = event.getSource();
if (object == smoothCheckBox)
smoothCheckBox_ItemStateChanged(event);
else if (object == sceneChoice)
sceneChoice_ItemStateChanged(event);
}
}
void smoothCheckBox_ItemStateChanged(java.awt.event.ItemEvent event)
{
// to do: code goes here.
smoothCheckBox_ItemStateChanged_Interaction1(event);
}
void smoothCheckBox_ItemStateChanged_Interaction1(java.awt.event.ItemEvent event)
{
try {
((SelectAPanoramaPanel)panel).setBilerpEnabled(smoothCheckBox.getState());
} catch (java.lang.Exception e) {
}
}
void sceneChoice_ItemStateChanged(java.awt.event.ItemEvent event)
{
// to do: code goes here.
sceneChoice_ItemStateChanged_Interaction1(event);
}
void sceneChoice_ItemStateChanged_Interaction1(java.awt.event.ItemEvent event)
{
try {
int i = sceneChoice.getSelectedIndex();
((SelectAPanoramaPanel)panel).setEnvMaps(frontmaps[i], rightmaps[i],
backmaps[i], leftmaps[i],
upmaps[i], downmaps[i]);
} catch (java.lang.Exception e) {
}
}
}